<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['算法管理','Python算法传感器检测']" icon="fa fa-subscript" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header><span class="widget-icon"> <i class="fa fa-table"></i> </span>
					<h2>Python算法传感器检测</h2></header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn" style="width: -moz-calc(100% - 210px);width: -webkit-calc(100% - 210px);width: calc(100% - 210px);">
								<sa-company-tree-car companyTreeId="companyTree" (companySelected)="companySelected($event)"></sa-company-tree-car>
						
								<div class="top_module top_module_box">
									<span class="top_module_label module_text">传感器类型</span>
									<sa-sensor-type (sensorSelected)="sensorSelected($event)" Height="28px" [isShow]='true' type='1' [inputParam]="inputParam" [isSendRequest]='false'></sa-sensor-type>
								</div>
								<div class="top_module top_module_box">
									<span class="top_module_label module_text">传感器状态</span>
									<select name="" class="top_module_select" [(ngModel)]="sensorState" style="min-width: 120px;">
										<option value="">全部</option>
										<option value="0">无损坏</option>
										<option value="1">有损坏</option>
									</select>
								</div>
								<!-- <div class="top_module top_module_box">
									<span class="top_module_label module_text">数据过滤</span>
									<select name="" class="top_module_select" [(ngModel)]="filterType" style="min-width: 120px;">
										<option value="1">全部</option>
										<option value="2">相同传感器保留一条记录</option>
									</select>
								</div> -->
								<!-- <div class="top_module top_module_box">
									<span class="top_module_label module_text">是否匹配</span>
									<select name="" class="top_module_select" [(ngModel)]="isMatch" style="min-width: 120px;">
										<option value="">全部</option>
										<option value="1">算法和人工比对匹配</option>
										<option value="2">无算法记录，有人工记录</option>
										<option value="3">有算法记录，无人工记录</option>
									</select>
								</div> -->
								<div class="top_module top_module_box">
									<span class="top_module_label module_text">时间类型</span>
									<select name="" class="top_module_select" [(ngModel)]="type" style="min-width: 120px;">
										<option value="1">创建时间</option>
										<option value="2">算法时间[开始]</option>
									</select>
								</div>
								<div class="selectDate top_module">
									<table-select-date [notInit]='true' (outerTime)="getSelectTableTime($event)"></table-select-date>
								</div>
								<button type="button" class="btn btn-primary" (click)="table_search()">查询</button>
								<!-- <button type="button" class="btn btn-primary" (click)="dataExceport()">导出</button> -->
							</div>
							<div class="right top-search">
								<input type="text" [(ngModel)]="searchKey" (change)="table_search()" class="search-input" placeholder="车牌...">
								<span class="top-search-box">
							        <button class="top-search-btn" type="button" (click)="table_search()"> <i class="fa fa-search"></i></button>
							    </span>
							</div>
						</div>
						<div class="table_scroll">
							<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<th>设备ID</th>
										<th>车牌号</th>
										<th>安装通道</th>
										<th>传感器类型</th>
										<!-- <th>在用通道/系数</th> -->
										<th>算法检测损坏通道</th>
										<th>开始时间[算法]</th>
										<th>结束时间[算法]</th>
										<th>人工检测问题</th>
										<!-- <th>开始时间[人工]</th>
										<th>结束时间[人工]</th>
										<th>是否匹配</th>
										<th>线材是否损坏[算法]</th> -->
										<th>创建时间</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of tableData; let i = index" [attr.data-index]="i" [ngClass]="{selected:activeSelected === row.id}">
										<td>{{row.deviceId ||'无' }}</td>
										<td>{{row.carNumber ||'无'}}</td>
										<td>
											<ng-container *ngFor="let item of row.sensorChannel;let isLast = last;">
												<span>{{item}}</span><span *ngIf="!isLast">，</span>
											</ng-container>
										</td>
										<td>
											<sa-sensor-type [sensorTypeId]="row.sensorType" type='2' [inputParam]="inputParam" [isSendRequest]='false'></sa-sensor-type>
										</td>
										<!-- <td>
											<ng-container *ngFor='let item of row.currentCoefT;let index = index;let isLast = last'>
												<span>
													<span style="font-weight: bold;">CH{{item.index}}</span>:{{item.value}}<span *ngIf="!isLast">，</span>
												</span>
											</ng-container>
										</td> -->
										<td>{{row.damageLineByAuto ||'无'}}</td>
										<td>{{row.startTimeByAuto ||'无'}}</td>
										<td>{{row.endTimeByAuto ||'无'}}</td>
										<td>
											<div *ngIf="row.sensorProblemList&& row.sensorProblemList.length > 0">
												<span *ngFor="let item of row.sensorProblemList,let i = index">{{item.sensorProblem}}<span *ngIf="i < row.sensorProblemList.length - 1">,</span></span>
												<button type="button" (click)="tablelook('1',row.sensorProblemList,problemModal)" style="margin-left: 10px;">查看</button>
											</div>
										</td>
										<!-- <td>{{row.startTimeByHand ||'无'}}</td>
										<td>{{row.endTimeByHand ||'无'}}</td>
										<td>
											<span *ngIf='row.isMatch == 0' class="orange">不匹配</span>
											<span *ngIf='row.isMatch == 1' class="green">匹配</span>
										</td>
										<td>
											<span *ngIf='row.lineBad == 0' class="green">无损坏</span>
											<span *ngIf='row.lineBad == 1' class="orange">损坏</span>
										</td> -->
										<td>{{row.createTime ||'无'}}</td>
										<td>
											<button type="button" (click)='checkAbnormal(row)'>查看</button>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator 
								[totalRecords]="totalCount" 
								[rows]="pageSize" 
								[currentPage]="curPage - 1" 
								(onPageChange)="paginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</sa-widgets-grid>
	<div style="background: white;border-radius: 5px;margin-top: 5px;position: relative;" [hidden]="!isChartView">
		<button (click)="closeChart()" class="div_closeBtn"> × </button>
		<div class="widget-body no-padding" style="margin: 0;">
			<div class="page-header clearfix s_table_opreation" style="margin: 0;">
				<div class="left page-header-btn" style="padding: 5px;">
					<div class="top_module">
						<span class="module_text" style="background: none;">数据折线图</span>
					</div>
					<div style="display: inline-block;">
						<div>
							<div class="selectDate top_module">
								<table-select-date [notInit]='true' [specifyId]='specifyId' [specifyTime]='specifyTime' (outerTime)="getSelectChartTime($event)"></table-select-date>
							</div>
							<button type="button" class="btn btn-primary" (click)="drawAbnormalChart()">查看</button>
						</div>
					</div>
				</div>
			</div>
		</div>
		<sa-chart-bmap [height]='325' [isAuditData]='false' [offDatas]='true' [inputParams]='selectedRow' [isBaiduMap]='true' (outerSend)="runParent($event)" (outerIsMap)='showMapView($event)'></sa-chart-bmap>
		<div [hidden]='!isMapView'>
			<sa-bmap-chart [trackParams]='drawTrackArr' [isShowBmap]='isMapView' deviceId="deviceId"></sa-bmap-chart>
		</div>
	</div>
</div>
<!-- 传感器详细问题 -->
<div bsModal #problemModal="bs-modal" id="problemModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
	<div class="modal-dialog modal-lg" style="width: 800px;">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" (click)="cancelProblemModal(problemModal)"
					aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<h4 class="modal-title">{{problemName}}详细问题</h4>
			</div>
			<div class="modal-body" style="padding: 15px 15px 30px 15px">
				<div class="table_scroll">
					<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
						<thead>
							<tr>
								<th>问题描述</th>
								<th>开始时间</th>
								<th>结束时间</th>
								<th>操作人</th>
								<th>操作时间</th>
							</tr>
						</thead>
						<tbody>

							<tr *ngFor="let row of ProblemModalTableData" >
								<td>
									<span *ngIf="problemName == '人工检测'">
										{{row.sensorProblem}}
									</span>
									<span *ngIf="problemName == 'GPS'">
										{{row.gpsProblem}}
									</span>
								</td>
								<td>{{row.startTime}}</td>
								<td>{{row.endTime}}</td>
								<td>{{row.operator}}</td>
								<td>{{row.operatingTime}}</td>
							</tr>
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>
</div>
<!-- 传感器详细问题 end-->